package cn.xm.basic.controller;

import cn.xm.basic.service.RegisterService;
import cn.xm.basic.util.AjaxResult;
import cn.xm.org.domain.ShopAuditLog;
import cn.xm.user.dto.PhoneRegisterDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/register")
public class RegisterController {
    @Autowired
    private RegisterService registerService;

    /**
     * 电话注册
     * @param dto
     * @return
     * @throws Exception
     */
    @PostMapping("/phone")
    public AjaxResult phoneRegister(@RequestBody @Valid PhoneRegisterDto dto) throws Exception {

        registerService.phoneRegister(dto);
        return AjaxResult.me().success();
    }
}
